import os

from celery import Celery
# 导入工程的配置文件
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mall.settings")
# 实例化celery
app = Celery(main='celery_tasks')
# 设置broker
app.config_from_object('celery_tasks.config')
# 让celery自动检测
app.autodiscover_tasks(['celery_tasks.sms'])
